﻿using System.Collections.Generic;
using System.Text.RegularExpressions;
//
namespace PerceptiveMCAPI
{
	public partial class EnumValues
	{
		// --------------------------------------------------------- Enumerated values
		public enum AccessType
		{
			NotSpecified = 0,
			XmlRpc = 1,
			Serial = 2,
			JSON = 3
		}
		//
		public enum OutputType
		{
			NotSpecified = 0,
			XmlRpc = 1,
			XML = 2,
			JSON = 3,
			JSON_FMT = 4,
			PHP = 5,
			Unformatted = 9
		}
		//
		public enum MethodType
		{
			NotSpecified = 0,
			GET = 1,
			POST = 2
		}
		public enum MessageLevel
		{
			NoMessage = 0,
			Information = 1,
			Warning = 2,
			Error = 4,
			Terminal = 8
		}
		//
		public enum generateText_type
		{
			NotSpecified = 0,
			html = 1,
			template = 2,
			url = 3,
			cid = 4,
			tid = 5
		}
		public enum listMembers_status
		{
			NotSpecified = 0,
			subscribed = 1,
			unsubscribed = 2,
			cleaned = 3,
			updated = 4
		}
		public enum listWebhookActions
		{
			NotSpecified = 0,
			subscribe = 1,
			unsubscribe = 2,
			profile = 3,
			cleaned = 4,
			upemail = 5
		}
		public enum listWebhookSources
		{
			NotSpecified = 0,
			user = 1,
			admin = 2,
			api = 3
		}

		public enum emailType
		{
			NotSpecified = 0,
			html = 1,
			text = 2,
			mobile = 3
		}
		public enum campaignSendTest_send_type
		{
			NotSpecified = 0,
			html = 1,
			text = 2
		}
		//
		public enum campaign_type
		{
			NotSpecified = 0,
			regular = 1,
			plaintext = 2,
			absplit = 3,
			rss = 4,
			trans = 5,
			//inspection = 6,		-- not valid for api
			auto = 7
		}
		public enum campaign_status
		{
			Unknown = 0,
			save = 1,
			sent = 2,
			paused = 3,
			sending = 4,
			schedule = 5
		}
		public enum content_type
		{
			NotSpecified = 0,
			html = 1,
			template = 2,
			url = 3
		}
		//
		public enum campaign_analytics
		{
			NotSpecified = 0,
			google = 1
		}
		//
		public enum stats_action
		{
			Undefined = 0,
			open = 1,
			click = 2
		}
		public enum campaignMembers_status
		{
			NotSpecified = 0,
			sent = 1,
			hard = 2,
			soft = 3
		}
		public enum folder_type
		{
			NotSpecified = 0,
			campaign = 1,
			autoresponder = 2
		}
		public enum template_type
		{
			NotSpecified = 0,
			user = 1,
			gallery = 2,
			@base = 3
		}
		// ---------------------------------------------- campaignShareReport
		public enum campaignShareReport_header_type
		{
			NotSpecified = 0,
			text = 1,
			image = 2
		}
		public enum campaignShareReport_theme_color_types
		{
			NotSpecified = 0,
			bg_color = 1,
			header_color = 2,
			current_tab = 3,
			current_tab_text = 4,
			normal_tab = 5,
			normal_tab_text = 6,
			hover_tab = 7,
			hover_tab_text = 8
		}

		// ---------------------------------------------- campaign rss opts
		public enum campaign_Rss_Schedule
		{
			NotSpecified = 0,
			daily = 1,
			weekly = 2,
			monthly = 3
		}
		public enum campaign_Rss_Weekday
		{
			Sunday = 0,
			Monday = 1,
			Tuesday = 2,
			Wednesday = 3,
			Thursday = 4,
			Friday = 5,
			Saturday = 6
		}
		// ---------------------------------------------- campaign a/b split
		public enum campaign_AB_split_test
		{
			NotSpecified = 0,
			subject = 1,
			from_name = 2,
			schedule = 3
		}
		public enum campaign_AB_pick_winner
		{
			NotSpecified = 0,
			opens = 1,
			clicks = 2,
			manual = 3
		}
		public enum campaign_AB_wait_units
		{
			NotSpecified = 0,
			hours = 3600,
			days = 86400
		}
		// ---------------------------------------------------------------------------------
		public enum field_Type
		{
			NotSpecified = 0,
			email = 1,
			text = 2,
			number = 3,
			radio = 4,
			dropdown = 5,
			date = 6,
			address = 7,
			phone = 8,
			url = 9,
			imageurl = 10
		}

		// --------------------------------------------------------------------------------- list grouping 
		public enum grouping_type_field
		{
			NotSpecified = 0,
			hidden = 1,
			checkboxes = 2,
			dropdown = 3,
			radio = 4
		}
		// --------------------------------------------------------------------------------- archive_type
		public enum archive_type
		{
			NotSpecified = 0,
			zip = 1,
			tar_gz = 2,
			tar_bz2 = 3,
			tar = 4,
			tqz = 5,
			tbz = 6
		}
		// -------------------------------- DEPRECATED v1.3.0 ----------------------------- chatter_type
		public enum chatter_type
		{
			Unknown = 0,
			scheduled = 1,
			sent = 2,
			inspection = 3,
			subscribes = 4,
			unsubscribes = 5,
			low_credits = 6,
			absplit = 7,
			best_opens = 8,
			best_clicks = 9,
			abuse = 13
		}
		// --------------------------------------------------------- Constant Values
		// response output
		public const string NotSupplied = "*** Not supplied ***";
		// validators
		public const string valNoProperty = "[ None ]";    // msg not property specific
		//
		public const string JSONErrorString = "{\"error\":\"";

		// from msdn, works with + addressing
		public static Regex rexEmail = new Regex( @"^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$", RegexOptions.IgnoreCase );
		// added option for domains with a '-' 
		public static Regex rexUrl = new Regex( @"^(?<Protocol>http|https):\/\/(?<Domain>[\w@][\w.:\-@]+)\/?[\w\.?=%&=\-@/$,]*$", RegexOptions.IgnoreCase );
		// ---------------------------------------------------------  

		#region Values Dictionaries, typically for dropdownlist loading
		// 
		public static Dictionary<string, int> generateTextTypeValues()
		{
			return apiHelper.GetEnumValues<generateText_type>();
		}
		public static Dictionary<string, int> listMemberStatusValues()
		{
			return apiHelper.GetEnumValues<EnumValues.listMembers_status>();
		}
		public static Dictionary<string, int> listEmailTypeValues()
		{
			return apiHelper.GetEnumValues<emailType>();
		}
		public static Dictionary<string, int> SendTypeValues()
		{
			return apiHelper.GetEnumValues<campaignSendTest_send_type>();
		}
		public static Dictionary<string, int> campaignStatusValues()
		{
			return apiHelper.GetEnumValues<campaign_status>();
		}
		public static Dictionary<string, int> campaignTypeValues()
		{
			return apiHelper.GetEnumValues<campaign_type>();
		}
		// 
		#endregion
		// ------------
	}
}
